<template>
  <div class="data-item-content">
    <h4 class="title">{{ title }}</h4> <!-- 标题 -->
    <p class="value">{{ value }} {{ unit }}</p> <!-- 值和单位 -->
  </div>
</template>

<script setup lang="ts">
defineProps({
  title: {
    type: String,
    required: true,
  },
  value: {
    type: [String, Number],
    required: true,
  },
  unit: {
    type: String,
    default: '',
  },
});
</script>

<style scoped>
.data-item-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: var(--card-background);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #fff; /* 确保内容字体为白色 */
}

.title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #fff; /* 标题字体为白色 */
}

.value {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  color: #fff; /* 确保值字体为白色 */
}
</style>
